/*
 * @Author: wangzhongjie
 * @Date: 2019-01-11 10:19:37
 * @LastEditors: wangzhongjie
 * @LastEditTime: 2019-01-16 14:21:56
 * @Description: 有品推荐
 * @Email: uvdream@163.com
 */

import 'package:flutter/material.dart';
class Products extends StatelessWidget{
  @override
  Widget build(BuildContext context){
    return Container(
      margin: const EdgeInsets.only(top:8),
      width: MediaQuery.of(context).size.width,
      color: Colors.white,
      child: Column(
        children: <Widget>[
          new Container(
            child: Text("有品推荐",style: TextStyle(fontSize: 15,fontWeight: FontWeight.w500),),
            padding: const EdgeInsets.only(left: 10,top: 15,bottom: 5),
            alignment: Alignment.centerLeft
          ),
          // Expanded(
            // Container(
            //   height: 500,
            //   child: GridView(
            //     physics: NeverScrollableScrollPhysics(),
            //     gridDelegate:SliverGridDelegateWithFixedCrossAxisCount(
            //       crossAxisCount: 2,
            //     ),
            //     children: <Widget>[
            //       new Container(
            //         height: 150,
            //         color: Colors.yellow,
            //       ),
            //        new Container(
            //         height: 150,
            //         color: Colors.red,
            //       ),
            //        new Container(
            //         height: 150,
            //         color: Colors.orange,
            //       ),
            //     ],
            //   ),
            // ),
          // ),
          new Container(
            height: 400,
            color: Colors.white,
            child: GridView(
              physics: NeverScrollableScrollPhysics(),
              gridDelegate:SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 2,
            ),
            children: <Widget>[
                new Container(
                    margin: const EdgeInsets.fromLTRB(10, 5, 5, 5),
                    // color: Color(0xffF2EEE4),
                    decoration: BoxDecoration(
                      color: Color(0xffF2EEE4),
                      borderRadius: new BorderRadius.only(topLeft: Radius.circular(10))
                    ),
                    child: Stack(
                      alignment: const FractionalOffset(1, 0),
                      children: <Widget>[
                        new Positioned(
                            top: 10,
                            left: 10,
                            child: Text("睿米周年庆")
                        ),
                        new Positioned(
                            top: 30,
                            left: 10,
                            child: Text('1.8-1.9全场最高降200',style: TextStyle(fontSize: 12,color: Colors.grey),)
                        ),
                        new Positioned(
                            top: 60,
                            left: 40,
                            child: new Container(
                              width: 120,
                              height: 100,
                              child:Image.asset("images/home/you1.png",fit:BoxFit.cover),
                            ),
                        )
                      ],
                  ),
                ),
               new Container(
                  margin: const EdgeInsets.fromLTRB(5, 5, 10, 5),
//                    color: Color(0xffE6EFEC)
                   decoration: BoxDecoration(
                       color: Color(0xffE6EFEC),
                       borderRadius: new BorderRadius.only(topRight: Radius.circular(10))
                   ),
                    child: Stack(
                      alignment: const FractionalOffset(1, 0),
                      children: <Widget>[
                        new Positioned(
                            top: 10,
                            left: 10,
                            child: Text("遇见温暖冬季")
                        ),
                        new Positioned(
                            top: 30,
                            left: 10,
                            child: Text('爆款最立省100元',style: TextStyle(fontSize: 12,color: Colors.grey),)
                        ),
                        new Positioned(
                            top: 60,
                            left: 40,
                            child: new Container(
                              width: 120,
                              height: 100,
                              child:Image.asset("images/home/you2.png",fit:BoxFit.cover),
                            ),
                        )
                      ],
                  ),
                ),
                 new Container(
                  margin: const EdgeInsets.fromLTRB(10, 5, 5, 5),
//                    color: Color(0xffECE9F4),
                   decoration: BoxDecoration(
                       color: Color(0xffECE9F4),
                       borderRadius: new BorderRadius.only(bottomLeft: Radius.circular(10))
                   ),
                    child: Stack(
                      alignment: const FractionalOffset(1, 0),
                      children: <Widget>[
                        new Positioned(
                            top: 10,
                            left: 10,
                            child: Text("暖冬爆品盘点")
                        ),
                        new Positioned(
                            top: 30,
                            left: 10,
                            child: Text('让科技为爱赋能',style: TextStyle(fontSize: 12,color: Colors.grey),)
                        ),
                        new Positioned(
                            top: 60,
                            left: 40,
                            child: new Container(
                              width: 120,
                              height: 100,
                              child:Image.asset("images/home/you3.png",fit:BoxFit.cover),
                            ),
                        )
                      ],
                  ),
                ),
                new Container(
                  margin: const EdgeInsets.fromLTRB(5, 5, 10, 5),
//                    color: Color(0xffF1E9EB),
                    decoration: BoxDecoration(
                        color: Color(0xffF1E9EB),
                        borderRadius: new BorderRadius.only(bottomRight: Radius.circular(10))
                    ),
                    child: Stack(
                      alignment: const FractionalOffset(1, 0),
                      children: <Widget>[
                        new Positioned(
                            top: 10,
                            left: 10,
                            child: Text("有品电源节")
                        ),
                        new Positioned(
                            top: 30,
                            left: 10,
                            child: Text('爆款直降低至5元',style: TextStyle(fontSize: 12,color: Colors.grey),)
                        ),
                        new Positioned(
                            top: 60,
                            left: 40,
                            child: new Container(
                              width: 120,
                              height: 100,
                              child:Image.asset("images/home/you4.png",fit:BoxFit.cover),
                            ),
                        )
                      ],
                  ),
                ),
            ],
            ),
          ),   
        ],
      ),
    );
  }
}